package com.fl.test.mapper;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import com.fl.Application;
import com.fl.mapper.TStudentMapper;
import com.fl.mapper.TStudyMapper;
import com.fl.model.TStudent;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class)
@WebAppConfiguration
public class StudyInsert {
	@Autowired TStudyMapper TStudyMapper;
	
	@Autowired TStudentMapper TStudentMapper;
	

	@Test
	public void testInsert100()
	{
		
/*		for(int i=0;i<100;i++)
		{
			TStudent model=new TStudent();
			String id=String.valueOf(i);
			model.setFid(id);
			model.setFname("z3"+id);
			model.setFage(40);
			model.setFremark("1");
			model.setFsex(1);
			TStudentMapper.insert(model);
		}
		*/

	}
	@Test
	public void test()
	{
		
	}
	
	@Test
	public void update()
	{
	/*	TStudent model=new TStudent();
		model.setFid("ak004");
		model.setFage(20);
		model.setFremark("spirngvue");
		TStudentMapper.updateByPrimaryKeySelective(model);*/
		
	}
	
	
	@Test
	public void delete(){
		/*TStudent model=new TStudent();
		model.setFid("ak004");
		TStudentMapper.deleteByPrimaryKey(model);
		*/
	}
	
	@Test
	public void Search(){
		
		
		TStudent model=new TStudent();
		model.setFid("001");
		model.setFname("z3");
		model.setFage(40);
		model.setFremark("1");
		model.setFsex(1);
		TStudentMapper.insert(model);
		List<TStudent> list=TStudentMapper.selectAll();
		System.out.println("*****************************************");
		System.out.println(list.get(0).getFname());
		
	}
	
	
	
	
}
